package com.campus.activity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.campus.activity.entity.Organizer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 组织者Mapper接口
 * 
 * @author System
 * @since 2024
 */
@Mapper
public interface OrganizerMapper extends BaseMapper<Organizer> {

    /**
     * 根据组织者姓名模糊查询
     * 
     * @param organizerName 组织者姓名
     * @return 组织者列表
     */
    @Select("SELECT * FROM organizer WHERE organizer_name LIKE CONCAT('%', #{organizerName}, '%') AND deleted = 0")
    List<Organizer> selectByOrganizerName(@Param("organizerName") String organizerName);

    /**
     * 根据联系方式查询组织者
     * 
     * @param contactInfo 联系方式
     * @return 组织者信息
     */
    @Select("SELECT * FROM organizer WHERE contact_info = #{contactInfo} AND deleted = 0")
    Organizer selectByContactInfo(@Param("contactInfo") String contactInfo);
}